import {BasePage, BaseInput, BaseRule} from "../../../../../ts/type";
import {replace} from "../../../../../ts/util";

export let entityColumnRelationSaveInit = (page: BasePage) => {
    let saveModel = page.models.filter(m => 'save' == m.formKey)[0]

// field input auto
// #bind.field.sourceFieldCode#
    saveModel.formInputs.push(replace(new BaseInput('依赖字段', 'sourceFieldCode'), {
        inputType: 'select',
        options: [],
        optionsUrl: '/au/entityColumn/fieldCode/select'
    }))
// $bind.field.sourceFieldCode$

// #bind.field.targetFieldCode#
    saveModel.formInputs.push(replace(new BaseInput('被依赖属性', 'targetFieldCode'), {
        inputType: 'select',
        options: [],
        optionsUrl: '/au/entityColumn/fieldCode/select'
    }))
// $bind.field.targetFieldCode$

// #bind.field.sourceTableCode#
    saveModel.formInputs.push(replace(new BaseInput('依赖表名', 'sourceTableCode'), {
        inputType: 'select',
        options: [],
        optionsUrl: '/au/entity/tableCode/select'
    }))
// $bind.field.sourceTableCode$

// #bind.field.targetTableCode#
    saveModel.formInputs.push(replace(new BaseInput('被依赖表名', 'targetTableCode'), {
        inputType: 'select',
        options: [],
        optionsUrl: '/au/entity/tableCode/select'
    }))
// $bind.field.targetTableCode$


// field rule auto

}